package net.aiion.weave.impl.bytecode.events;

import net.aiion.weave.spi.bytecode.BytecodeVisitor;
import net.aiion.weave.spi.bytecode.events.IntInstructionBytecodeEvent;

public class IntInstructionBytecodeEventImpl extends BytecodeEventImpl implements IntInstructionBytecodeEvent
{
    private int opcode;
    private int operand;

    public IntInstructionBytecodeEventImpl(final int aOpcode, final int aOperand) {
        opcode = aOpcode;
        operand = aOperand;
    }

    @Override
    public int getType() {
        return INT_INSTRUCTION;
    }

    @Override
    public void setOpcode(final int aOpcode) {
        opcode = aOpcode;
    }

    @Override
    public int getOpcode() {
        return opcode;
    }

    @Override
    public void setOperand(final int aOperand) {
        operand = aOperand;
    }

    @Override
    public int getOperand() {
        return operand;
    }

    @Override
    public BytecodeVisitor acceptBytecodeVisitor(final BytecodeVisitor aBytecodeVisitor) {
        aBytecodeVisitor.asBytecodeMethodVisitor().visitIntInstruction(this);
        return aBytecodeVisitor;
    }
}
